<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>商城名称1管理中心</title>
<link href="css/globle.css" type="text/css" rel="stylesheet" />
<script type="text/javascript">
function checkedThis(parentId,obj){
	var div = document.getElementById(parentId) 
	var uls = div.getElementsByTagName("li"); 
	for(var  i=0;i<uls.length;i++){
		uls[i].className='';
	}
	obj.className="cur";
	var cate_id = obj.getAttribute('cate_id');	
	//alert(cate_id);		
	if(cate_id != null){
		var ccc = document.getElementById("catee").value = cate_id;
		$.post(
			'ajax.php?action=getUnit',
			{cate_id:ccc},
			function(data){
				$("select:[name=unit1]").html(data);				
			}
		)
	}
}
var displayCate1="";
var displayCate2="";

function changeCategory(categoryId,showId){
	clearCache(showId);
	var nextId = "";
	if('subCategoryId1'==showId){
		nextId = "subCategoryId2";
	}else if('subCategoryId2'!=showId){
		return;	
	}
	var pathUrl = "ajax.php?action=showsubcats&categoryId="+categoryId+"&showId="+showId+"&nextId="+nextId;
	$.post(
		pathUrl,
		{categoryId:categoryId},
		function(data){
			$("#"+showId).html(data);
		}
	)
}

function clearCache(showId){
	if('subCategoryId0'==showId){
		document.getElementById('subCategoryId1').innerHTML = "";
	}
}

function displayCate(categoryName,categoryId){
	if(categoryId=="subCategoryId0"){
		displayCate1=categoryName;
		document.getElementById('currentCategory').innerHTML="<font color='#F68704'>"+displayCate1+"</font>";
	}
	if(categoryId=="subCategoryId1"){
		displayCate2=categoryName;
		document.getElementById('currentCategory').innerHTML="<font color='#F68704'>"+displayCate1+"</font>"+" > "+"<font color='#F68704'>"+displayCate2+"</font>";
	}
}	
</script>
<body>
		<div class="list-box" id="subCategoryId0">
			<ul>
				<li style="text-align:left;" onClick="javascript:checkedThis('subCategoryId0',this);changeCategory('1','subCategoryId1');displayCate('手机 电脑 相机','subCategoryId0')">手机 电脑 相机</li>
				<li style="text-align:left;" onClick="javascript:checkedThis('subCategoryId0',this);changeCategory('114','subCategoryId1');displayCate('测试页码','subCategoryId0')"   >测试页码</li>
			</ul>
		</div>
	<div class="list-box" id="subCategoryId1"><ul></ul></div>
</html>